package edu.ucsb.cs56.W12.chatclient.junit;

import static org.junit.Assert.*;
import org.junit.Test;
import edu.ucsb.cs56.W12.chatclient.model.Client;

/**
 * ClientTester class is the JUnit tests for the Client
 * @author Peng Wang with Andro Stotts
 * @version 0.1
 */

public class ClientTester {
	
	/**
	 * Tests the return of getClient() to see if it is an object of the Client class
	 */
	@Test
	public void testGetClient() {
		Client client = Client.getClient();
		assertEquals(Client.class, client.getClass());
	}

	/**
	 * Tests getName()
	 */
	@Test
	public void testGetName() {
		Client client = Client.getClient();
		client.setName("Peng Wang");
		assertEquals("Peng Wang", client.getName());
	}

	/**
	 * Tests getServerIp()
	 */
	@Test
	public void testGetServerIp() {
		Client client = Client.getClient();
		client.setServerIp("192.168.1.1");
		assertEquals("192.168.1.1", client.getServerIp());
	}

	/**
	 * Tests getClientIp()
	 */
	@Test
	public void testGetClientIp() {
		Client client = Client.getClient();
		client.setClientIp("192.168.1.1");
		assertEquals("192.168.1.1", client.getClientIp());
	}
}
